package com.example.android.ui.home.adapter;

import android.util.Log;

import androidx.recyclerview.widget.GridLayoutManager;

import com.example.android.bean.Goods;

import java.util.List;

public class HomeSpanSizeLookup extends GridLayoutManager.SpanSizeLookup {

    private  List<Goods> goodsList;

    public HomeSpanSizeLookup(List<Goods> goodsList) {
        this.goodsList = goodsList;
    }

    @Override
    public int getSpanSize(int position) {
        return goodsList.get(position).getSpanSize();
    }

    public void setGoods(List<Goods> goodsList) {
        this.goodsList.clear();
        this.goodsList.addAll(goodsList);

    }
}
